class Solution {
public:
    string hash[10]={"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
    string path;
    vector<string> ret;
    vector<string> letterCombinations(string digits) {
        //对于每个数字找到对应的一个字符
       if(digits.empty()) return ret;
       dfs(digits,0);
       return ret;
    }

    void dfs(string&digits,int p)
    {
        if(p==digits.size())
        {
            ret.push_back(path);
            return;
        }
        string tem=hash[digits[p]-'0'];
        for(int i=0;i<tem.size();i++)
        {
            path.push_back(tem[i]);
            dfs(digits,p+1);
            path.pop_back();
        }
    }
};